// ChessUtils.h
//
// Created By: Jeremy Butler
// Created On: 08-Apr-2011
//
// These are commonly used methods throughout the whole chess program.

#ifndef CHESS_UTILS_H
#define CHESS_UTILS_H

#include "Piece.h"
#include "Pawn.h"
#include "Rook.h"
#include "Knight.h"
#include "Bishop.h"
#include "King.h"
#include "Queen.h"
using namespace std;

static Piece * PieceFactory(Color color, PieceType type){
  if(type == PAWN)
    return new Pawn(color);
  else if(type == ROOK)
    return new Rook(color);
  else if(type == KNIGHT)
    return new Knight(color);
  else if(type == BISHOP)
    return new Bishop(color);
  else if(type == QUEEN)
    return new Queen(color);
  else if(type == KING)
    return new King(color);
  else
    return NULL;
}

#endif /* CHESS_UTILS_H */
